<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background: #000;
        }
    </style>
</head>
<body>
<p>p元素的数量</p>
<p>p元素的数量</p>
<p>p元素的数量</p>
<p>p元素的数量</p>
<p>p元素的数量</p>
<p>p元素的数量</p>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
<script type="text/javascript">
    jQuery(document).ready(function () {
        alert("page contains " + $('p').length + "<p> elements!");
    })
</script>
</body>
</html>